package com.yn.pet.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum CircleActionEnum  {

    // 更新区域，code 对应 0
    UPDATE_AREA(0, "更新区域"),
    // 追加区域，code 对应 1
    APPEND_AREA(1, "追加区域"),
    // 修改区域，code 对应 2
    MODIFY_AREA(2, "修改区域");

    private Integer code;
    private String name;

    public static CircleActionEnum getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (CircleActionEnum propertyEnum : CircleActionEnum.values()) {
            if (propertyEnum.getCode().equals(code)) {
                return propertyEnum;
            }
        }
        return null;
    }
}
